/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package football;

import java.util.List;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;
import javax.jws.WebService;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Herbert
 */
@Stateless
@LocalBean
@WebService
public class publicService {
      @PersistenceContext(unitName = "football-ejbPU")
    private EntityManager em;
      
      
      public List<Sitzplatz> findFreePlace(){
          
          
          try{
              return em.createNamedQuery("Sitzplatz.findAll",Sitzplatz.class).getResultList();
          }
          catch(NoResultException e){
              return null;
          }
          
      }

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

}
